(define *kR:mixer* 0)
(define *kR:current-mixer-slot* 0)

(define (mixer-path)
  (io:make-directory (kR:pathTo "save/" *kR:current-set*))
  (io:make-directory (kR:pathTo "save/" *kR:current-set* "/" *kR:current-song*))
  (kR:pathTo "save/" *kR:current-set* "/" *kR:current-song* "/mixer.txt"))

(define (init-graph)
  
  (au:clear-graph)

  ;the Mixer
  (set! *kR:mixer* (au:make-node "aumx" "smxr" "appl"))
  (au:connect-node *kR:mixer* 0 *au:output-node* 0)
  (au:update-graph)
  ;; the current Slot in the mixer
  (set! *kR:current-mixer-slot* 0)
  ;;load mixer preset if it exists
  (if (io:file-exists? (mixer-path))
      (au:load-preset *kR:mixer* (mixer-path))))